From: Jonas Dreßler Date: Sat, 27 Jul 2019 17:29:36 +0000 (+0200) Subject: shellDBus: Use floats instead of percentages for OSD levels X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~839^2^2~104 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=89ce53e3ff7a0396c55920e3365d16de7f3e28d0;p=gnome-shell.git shellDBus: Use floats instead of percentages for OSD levels Due to typecasting being done when converting floats to integers in gnome-settings-daemon, a volume of 0.9% in g-s-d will end up as 0% in gnome-shell. This can lead to a mismatch of icons between the volume OSD (the icon to use is determined by g-s-d itself) and the shells own volume indicator (the icon to use is determined by the shell using the volume received from g-s-d). To fix this, simply get rid of the conversion from float to percentage in g-s-d and back to floats in the shell and just send a float/double value on DBus. https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/78 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385 --- diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index a287a3fb6..e750c207f 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -94,12 +94,6 @@ var GnomeShell = class { if (serializedIcon) icon = Gio.Icon.new_for_string(serializedIcon); - // Translate from percentages in the D-Bus API to floats - if (!isNaN(level)) - level /= 100; - if (!isNaN(maxLevel)) - maxLevel /= 100; - Main.osdWindowManager.show(monitorIndex, icon, label, level, maxLevel); }